
$('#search').click(function () {
    search();
});

let search = function(){
    let where = {};
    let input = $('#form').find('input');
    let select = $('#form').find('select');
    if (input.length>0){
        input.each(function (i,a) {
            let name = $(a).attr('name');
            if (name !== undefined) {
                where[name] = $(a).val();
            }
        });
    }
    if (select.length>0){
        select.each(function (i,a) {
            let name = $(a).attr('name');
            if (name !== undefined) {
                where[name] = $(a).val();
            }
        });
    }
    dataTable.reload({
        where:where,
        page: {
            curr:1
        }
    })
}



